package com.sens.ipc.alipay.hooker;

import android.content.Context;
import android.content.Intent;

import com.sens.ipc.alipay.Action;
import com.sens.ipc.common.CommonAction;


public abstract class Handle implements Callback {
    private Context context;

    protected Handle(Context context) {
        this.context = context;
    }

    @Override
    public void startQuartz() {
        context.sendBroadcast(new Intent(Action.Hooker.ACTION_START_QUARTZ));
    }

    @Override
    public void checkUserId() {
        context.sendBroadcast(new Intent(Action.Hooker.ACTION_CHECK_USERID));
    }

    @Override
    public void test() {
        context.sendBroadcast(new Intent(Action.Hooker.ACTION_TEST));
    }

    @Override
    public void setMonitor(String monitor) {
        Intent intent = new Intent(Action.Hooker.ACTION_SET_MONITOR);
        intent.putExtra(Action.Hooker.ACTION_SET_MONITOR, monitor);
        context.sendBroadcast(intent);
    }

    @Override
    public void setHost(String host) {
        Intent intent = new Intent(CommonAction.Hooker.ACTION_SET_HOST);
        intent.putExtra(CommonAction.Hooker.ACTION_SET_HOST, host);
        context.sendBroadcast(intent);
    }

    public abstract void unBind();
}
